/*wxBtVHTjruFsGR5nLWPsoOgeib0BPjtq0fKrsrIKiQ5fgE0ZcpyBjRpbcb/Grpwe*/
/*
 * @Author: xiahui 
 * @PageInfo: 列表查询实现 
 * @Date: 2019-01-15 09:15:33 
 * @Last Modified by: xiahui
 * @Last Modified time: 2019-08-06 08:52:24
 */
import { ajax } from 'nc-lightapp-front';
import { AREA, PAGECODE, URL, FIELDS } from '../../constance';
import { showHasQueryResultInfo, showNoQueryResultInfo } from '../../../../../scmpub/scmpub/pub/tool/messageUtil';

export default function(props, queryInfo) {
	let reqData = {
		queryInfo: queryInfo,
		templetid: props.meta.getMeta().pageid,
		pageCode: PAGECODE.ref20Pagecode
	};

	// 设置‘已生成订单量作为合同执行’值，用于拉单时设置该默认值
	this.bordernumexec = ((props.search.getSearchValByField(AREA.searchId, FIELDS.bordernumexec) || {}).value ||
		{}).firstvalue;

	ajax({
		url: URL.query20,
		data: reqData,
		success: (res) => {
			if (res.data) {
				props.transferTable.setTransferTableValue(
					AREA.srcHead,
					AREA.srcBody,
					res.data,
					FIELDS.pk_praybill,
					FIELDS.pk_praybill_b
				);
				showHasQueryResultInfo(res.data.length);
			} else {
				props.transferTable.setTransferTableValue(
					AREA.srcHead,
					AREA.srcBody,
					[],
					FIELDS.pk_praybill,
					FIELDS.pk_praybill_b
				);
				showNoQueryResultInfo();
			}
			this.setState({
				ntotalnum: 0
			});
		}
	});
}

/*wxBtVHTjruFsGR5nLWPsoOgeib0BPjtq0fKrsrIKiQ5fgE0ZcpyBjRpbcb/Grpwe*/